package com.zb.spring5.inteface;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("render")
public class StandarOutMessagerRender implements MessageRender {

    private MessagePrivider messagePrivider;
    public void render() {
        if (messagePrivider == null) {
            throw new RuntimeException("你必须设置"+StandarOutMessagerRender.class.getName()+"的messagePrivider属性");
        }
        System.out.println("渲染成功");
    }
    @Autowired
    public void setMessagePrivider(MessagePrivider messagePrivider) {
        this.messagePrivider = messagePrivider;
    }

    public MessagePrivider getMessagePrivider() {
        return this.messagePrivider;
    }
}
